Perlshop 4 Custom Order ID Generator Plugin
Version 1.0
by
Chris Milner, Vintage-Books.com
Dave Godwin, Waverider Systems

This plugin requires Perlshop 4.4.02, Beta 1, or later.  

--------------------------------------------------------------------------------------
Overview:

This plugin creates an !ORDERID! with a custom prefix or confines the numbers to a specified range. 

--------------------------------------------------------------------------------------
Installation Procedure:
1.      Place the PS_CreateID.pm file into the same web server directory as your perlshop.cgi file.

2.      Give the PS_CreateID.pm file the same file permissions as your perlshop.cgi file.

3.      Add the Custom Order ID Generator plugin to the plugin registration table in your ps.cfg file.

Example plugin registration table before adding the Custom Order ID Generator plugin:
# Plugin modules.  See the external documentation for details.
%plugins =
(
    # Calendar example plugin
    'calendar'  => 
    {
        'program'    => 'ps_plugin_gencal.pl'
    }
);


Example plugin registration table after adding the Custom Order ID Generator plugin:
# Plugin modules.  See the external documentation for details.
%plugins =
(
	# Create Order_ID plugin
	'orderid' =>
	{
		'module' => 'PS_CreateID.pm',
		'event'     => 'orderid',
		'prefix_type' => 'mmddhh',
		'range_min' => '1000000000',
		'range_max' => '3000000000',
		'display' => 'no'
	},


	# Calendar example plugin
	'calendar' => 
	{
		'program'   =>     'ps_plugin_gencal.pl'
	}
);
	
--------------------------------------------------------------------------------------
Using the Custom Order ID Generator plugin:

Pick the format for the prefix.  Supported values for prefix_type:  

		'prefix_type' => 'mmddhh',
				
This will add a prefix like 042413**** to the order-id to represent April 24, 1p.m. as the date & time.
NOTE:  The setting for $id_length in ps.cfg should be at least 9 for this format.	Range settings are ignored.


		'prefix_type' => 'yyyymmdd',
		
This will add a prefix like 20030424*** to the order-id to represent April 24, 2003 as the date.	
NOTE:  The setting for $id_length in ps.cfg should be at least 11 for this format.	Range settings are ignored.


		'prefix_type' => 'range',	
		'range_min' => '1000000000',
		'range_max' => '3000000000',
	
This will create an order-id like 2503047412, which is between 1000000000 and 3000000000.		
You can change your min/max values as you like, though make sure the max value is larger than the min value.
NOTE:  The setting for $id_length in ps.cfg should match the numbers in your given range.  If your min/max has 10 digits, set $id_length = 10.
	 	

Once installed, this program will be automatically used by Perlshop.  No other modifications are required.

If you have questions, or suggestions for a new prefix, please 
contact Chris Milner at web@vintage-books.com.